import { createConnection } from 'typeorm';
import { databaseConfig } from './config/database.config';

export class Core {
  private static instance: Core;

  private constructor() {}

  static get ins(): Core {
    if (!Core.instance) {
      Core.instance = new Core();
    }
    return Core.instance;
  }

  async connect() {
    // try {
    //   const connection = await createConnection(databaseConfig);
    //   console.log('数据库连接成功');
    //   return connection;
    // } catch (error) {
    //   console.error('数据库连接失败:', error);
    //   throw error;
    // }
  }
}